
#include <bits/stdc++.h>

const int N = 1e6+10;

using namespace std;
int n,m;
int arr[N];

void select()
{
	int minV;
	for(int i = 1;i < n;i++)
	{
		minV = i;
		for(int j = i+1;i <= n;j++)
		{
			if(arr[minV] > arr[j]) minV = j;
		}
		if(minV != i) swap(arr[minV],arr[i]);
	}
}
int find(int tar)
{
	for(int i = 1;i <= n;i++)
		if(arr[i] == tar) return i;
	return 0;
}
void print()
{
	for(int i = 1;i <= n;i++)cout<<arr[i]<<" ";
	cout<<endl;
}
void slove()
{
	cin >> n;
	for(int i = 1;i <= n;i++)cin >> arr[i];
	//查找的内容
	cin >> m;
	if(find(m))puts("YES");
	else puts("NO");
}
int main() {
	int T = 1;
	//cin >> T;
	while(T--)slove();



	return 0;
}

